package com.t371.spring.entity;

public class Player {
    private String name;
    private Equip armet;
    private Equip loricae;
    private Equip boot;
    private Equip ring;

    // 构造器、getter和setter
    public Player() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Equip getArmet() {
        return armet;
    }

    public void setArmet(Equip armet) {
        this.armet = armet;
    }

    public Equip getLoricae() {
        return loricae;
    }

    public void setLoricae(Equip loricae) {
        this.loricae = loricae;
    }

    public Equip getBoot() {
        return boot;
    }

    public void setBoot(Equip boot) {
        this.boot = boot;
    }

    public Equip getRing() {
        return ring;
    }

    public void setRing(Equip ring) {
        this.ring = ring;
    }

    public void updateEquip(Equip equip) {
        // 根据装备类型更新玩家装备
        if ("armet".equals(equip.getType())) {
            this.armet = equip;
        } else if ("loricae".equals(equip.getType())) {
            this.loricae = equip;
        } else if ("boot".equals(equip.getType())) {
            this.boot = equip;
        } else if ("ring".equals(equip.getType())) {
            this.ring = equip;
        }
    }

    public void displayRingAttributes() {
        if (ring != null) {
            System.out.println("Ring: " + ring.getName() +
                    ", Speed: " + ring.getSpeedPlus() +
                    ", Attack: " + ring.getAttackPlus() +
                    ", Defence: " + ring.getDefencePlus());
        }
    }
}
